let arr = [5, 6, 7, 8, 1, 2, 3];
let result = arr.map(item => {
  return item * 2;
});
console.log(result); //[ 10, 12, 14, 16, 2, 4, 6 ]

let arr1 = [
  {
    name: 'zg',
    age: 18
  },
  {
    name: 'kobe',
    age: 35
  },
  {
    name: 'lucy',
    age: 22
  },
];
result = arr1.map(item => {
  return {
    name: item.name + " haha",
    age: item.age + 100
  };
});
console.log(result);
/**结果
[
  {name: 'zg haha', age: 118},
  {name: 'kobe haha', age: 135},
  {name: 'lucy haha', age: 122},
]
 */
